package main

import (
	srv "common"
	"github.com/gin-gonic/gin"
	_ "project/api"
	"project/config"
	"project/router"
)

func main() {
	r := gin.Default()

	// 获取与jaeger对接好的provider接口
	config.InitConfig()
	//tp, tpErr := tracing.JaegerTraceProvider()
	//if tpErr != nil {
	//	log.Fatal(tpErr)
	//}
	//
	//otel.SetTracerProvider(tp) // 设置全局的provide
	//otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}))

	// 路由注册
	router.InitRouter(r)
	srv.Run(r, config.AppConf.Sc.Name, config.AppConf.Sc.Addr, nil)

	// User grpc 连接注册 初始化rpc调用
	// router.InitUserGrpc()
}
